package net.wanglu.www.spdr.fixer;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import net.wanglu.www.spdr.entities.Corpus;

public class DailyExpressFixer implements Fixer {

	private List<Fixer> jointFixer = null;
	
	public List<Fixer> getJointFixer() {
		return jointFixer;
	}
	public void setJointFixer(List<Fixer> jointFixer) {
		this.jointFixer = jointFixer;
	}

	@Override
	public Corpus fix(Corpus corpus) throws Exception {
		// TODO Auto-generated method stub
		if ( jointFixer == null ) {
			jointFixer = new ArrayList<Fixer>(4);
			jointFixer.add(new HtmlEntityFixer());
			jointFixer.add(new DateFixer());
			jointFixer.add(new SpaceFixer());
			jointFixer.add(new CRFixer());
		}
		
		for( Iterator<Fixer> itr = jointFixer.iterator(); itr.hasNext(); ) {
			Fixer fixer = itr.next();
			fixer.fix(corpus);
		}
		return corpus;
	}

}
